<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Http\Request;
// 利用门面进行Auth认证
use Illuminate\Support\Facades\Auth;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    // 判断Session是否存有当前用户信息,进行路由分发
    public function redirect(Request $request) {
    	// 用户权限检测
    	if (Auth::check() == true) {
    		return redirect('/admin');
    	}else {
    		return redirect('/login');
    	}
    }

}
